SELECT * FROM FATURAMENTO_IMAGEM WHERE SUBSTRING(FILIAL,1,3) = '110' AND NUMERO_FISCAL like '%736950'
SELECT * FROM FATURAMENTO_IMAGEM WHERE SUBSTRING(FILIAL,1,3) = '110' AND NUMERO_FISCAL like '%2311'

SELECT * FROM FATURAMENTO_IMAGEM 
WHERE SUBSTRING(FILIAL,1,3) = '110' 
AND DATEPART(YYYY,EMISSAO) =2008
order by numero_fiscal

SELECT * FROM FATURAMENTO WHERE NF_saida like '%736950'
SELECT * FROM FATURAMENTO WHERE NF_saida = '002311'

lx_cade faturamento			
SELECT * FROM LOJA_SAIDAS WHERE SUBSTRING(FILIAL,1,3) = '110' AND NUMERO_NF_TRANSFERENCIA like '%2311'
SELECT * FROM LOJA_SAIDAS WHERE SUBSTRING(FILIAL,1,3) = '110' AND NUMERO_NF_TRANSFERENCIA like '%736950'

SELECT * FROM FATURAMENTO_IMAGEM WHERE FILIAL = '110_NORTESHOPPING' AND NUMERO_FISCAL like '%2311' 
SELECT * FROM FATURAMENTO_IMAGEM WHERE FILIAL = '110_NORTESHOPPING' AND NUMERO_FISCAL like '%736950' 

SELECT * FROM entradas WHERE SUBSTRING(FILIAL,1,3) = '800' AND NF_entrada like '%2311'



begin transaction
delete FATURAMENTO where NF_saida = '736950'
commit
rollback

SELECT * FROM FATURAMENTO WHERE NF_saida like '%736950'
SELECT * FROM FATURAMENTO WHERE NF_saida = '002311'